home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_10.lha
/
5_10
/
5_10c4.h
< prev
next >
Wrap
Text File
|
1993-08-08
|
807b
|
41 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Allocate the space and set the type for a given name
ardata* tableentry::settype(char *nm, vartypes v)
// allocate the data space
name *n = tbl->insert(nm);
vardata *nv = new vardata;
n->pvalue = nv;
nv->address = address_offset;
// add in the appropriate size
switch (v)
{
case tinteger:
nv->type = tinteger;
address_offset += sizeinteger;
break;
case tsingle:
nv->type = tsingle;
address_offset += sizesingle;
break;
default:
case tdouble:
nv->type = tdouble;
address_offset += sizedouble;
break;
case tstring:
nv->type = tstring;
address_offset += sizestring;
break;
}
return nv;